<!--{assign var="menu_id" value="friend"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}--> 
<!--{include file="<!--{$oetplpath}-->block_top.tpl"}-->
<!--{include file="<!--{$oetplpath}-->block_banner.tpl"}-->
<div class="oe_inmain"> 
  <!--{include file="<!--{$oetplpath}-->block_left.tpl"}-->
  <div class="right">
    <div class="oe_ufriend">
      <div class="oe_unav"> 好友申请 </div>
      <div class="oe_utitle">
        <ul>
          <li><a href="<!--{$oefile}-->&c=friend">我的好友</a></li>
		  <li><a href="<!--{$oefile}-->&c=friendapply" class="current">好友申请</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      
      <div class="friendapply_list">

        <div class="total_tips">
          <p class="text">
            您共有 <b><!--{$total}--></b> 个好友申请！<br>
			完善个人资料、和升级会员可提高人气哦！~
          </p>
          <div class="btn">
            <span class="span_1"><a href="<!--{$oefile}-->&c=vip">升级会员</a></span>
            <span class="span_2"><a href="<!--{$oefile}-->&c=profile">完善资料</a></span>
          </div>
		  <div class="clear"></div>
        </div>

		<!--{if empty($friendapply)}-->
        <div class="oe_nodata">
          <p class="p_1"><img src="<!--{$userskin}-->images/nodata.jpg" /></p>
          <p class="p_2">没有符合条件的信息！</p>
        </div>
		<!--{else}-->
        <div class="bd">
          <!--{foreach $friendapply as $volist}-->
          <dl id="friendapply_<!--{$volist.applyid}-->" f="show_del">
            <dt><span><a href="<!--{$volist.homeurl}-->" target="_blank"><img src="<!--{$volist.headimg}-->" /></a></span></dt>
            <dd>
              <h3>
			    <a href="<!--{$volist.homeurl}-->" target="_blank"><!--{$volist.username}--></a> 
                <span><!--{$volist.addtime|date_format:"%Y/%m/%d %H:%M"}--></span>
              </h3>
              <p class="p_1">
			    <!--{$volist.age}-->岁 
				<!--{area type="text" value=$volist.dist1}--> <!--{area type="text" value=$volist.dist2}-->
				<!--{if $volist.height > 0}-->
				<!--{$volist.height}--> CM
				<!--{/if}-->
				<!--{hook mod="var" item="marry" type="text" value=$volist.marry}-->
			  </p>
              <p class="p_2">
			    <!--{if $volist.flag == '1'}-->
                <span class="span_1 current">已同意</span>
				<!--{elseif $volist.flag == '2'}-->
                <span class="span_2 current">已拒绝</span>
				<!--{else}-->
				<span class="span_1 cursor" f="but_friendapply_do" data-type="agree" data-id="<!--{$volist.applyid}-->"><i></i>同意</span>
				<span class="span_2 cursor" f="but_friendapply_do" data-type="refuse" data-id="<!--{$volist.applyid}-->"><i></i>拒绝</span>
				<!--{/if}-->
              </p>
              <span class="del cursor" f="but_friendapply_do" data-type="delete" data-id="<!--{$volist.applyid}-->" style="display:none;"></span>
            </dd>
            <div class="clear"></div>
          </dl>
          <!--{/foreach}-->
          <div class="clear"></div>
        </div>

		<!--{if !empty($showpage)}-->
		<div class="oe_page"> <!--{$showpage}--> </div>
		<!--{/if}--> 
		<!--{/if}-->

      </div>
	  <!--//friendapply_list End-->
      
    </div>
  </div>
  <div class="clear"></div>
</div>
<!--{include file="<!--{$oetplpath}-->block_footer.tpl"}-->
<script type="text/javascript">
$(function(){
	//同意、拒绝、删除操作
	$(document).on("click", "[f='but_friendapply_do']", function(){
		$_id = $(this).attr("data-id");
		$type = $(this).attr("data-type"); //agree,refuse,delete
		$_url = _OE_FILE+"&c=<!--{$c}-->&a="+$type+"&id="+$_id;
		if ($type == "delete") {
			$_text = "确定要删除吗？";
		}
		else {
			$_text = "确定执行此操作吗？";
		}
		oeAjaxConfirmBox($_url, $_text, function(){
			if ($type == "agree") { //同意
				$("#friendapply_"+$_id).find(".span_1").addClass("current");
				$("#friendapply_"+$_id).find(".span_1").attr("f", "");
				$("#friendapply_"+$_id).find(".span_1").html("已同意");

				$("#friendapply_"+$_id).find(".span_2").remove();
			}
			else if ($type == "refuse") { //拒绝			
				$("#friendapply_"+$_id).find(".span_2").addClass("current");
				$("#friendapply_"+$_id).find(".span_2").attr("f", "");
				$("#friendapply_"+$_id).find(".span_2").html("已拒绝");

				$("#friendapply_"+$_id).find(".span_1").remove();
			}
			else if ($type == "delete") { //删除
				$("#friendapply_"+$_id).remove();
			}
		});

	});

	//显示隐藏 删除按钮
	$(document).on("mouseover", "[f='show_del']", function(){
		if ($(this).find(".del").css("display") == "none") {
			$(this).find(".del").show();
		}
	});
	$(document).on("mouseout", "[f='show_del']", function(){
		if ($(this).find(".del").css("display") == "block") {
			$(this).find(".del").hide();
		}
	});



});
</script>
</body>
</html>